package cn.lenovo.com.sentiment.domain;

import java.io.Serializable;
import java.util.Set;

public class User implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -8060175310466383882L;
	private Integer id;
	private String username;
	private String password;
	private String email;
	private Integer level;
	private Set<UploadFile> uploadFiles;
	
	public User(String username,String password)
	{
		this.username=username;
		this.password=password;
	}
	public User(String username,String password,String email)
	{
		this(username, password);
		this.email=email;
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public Integer getLevel() {
		return level;
	}
	public void setLevel(Integer level) {
		this.level = level;
	}
	public Set<UploadFile> getUploadFiles() {
		return uploadFiles;
	}
	public void setUploadFiles(Set<UploadFile> uploadFiles) {
		this.uploadFiles = uploadFiles;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		User other = (User) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	

}
